package com.schoolai.schoolsystem.controller;

import com.schoolai.schoolsystem.service.ISmsService;
import com.schoolai.util.base.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Copyright(C),2019-2025，XX公司
 * FileName:SmsOperation
 * Author:bobby
 * 创建时间：2025/11/12 10:30
 * Description:短信相关操作
 * History:
 * <auth>        <time>       <version>       <desc>
 * 作者          修改时间       版本号         描述
 */
@RestController
@RequestMapping("/sms")
@Tag(name = "短信相关操作", description = "短信相关操作")
@Slf4j
public class SmsOperationController {
    @Autowired
    ISmsService SmsService;
    @Operation(summary = "短信发送")
    @PostMapping("/sendSms")
    @ApiResponses({
            @ApiResponse(responseCode = "20000", description = "操作成功"),
            @ApiResponse(responseCode = "999", description = "错误")
    })
    public Result sendSms(@Parameter(description = "电话号码", required = true, example = "13500000001") String phone,
                          @Parameter(description = "信息内容", required = true, example = "测试信息") String content) {
        SmsService.sendSms(phone, content);
        return Result.ok();
    }
}
